#include "Tracklet.h"

Tracklet::Tracklet() 
{
	label = 0;
}

Tracklet::~Tracklet() {}

bool Tracklet::CheckExistFrame(int frm)
{
	for (int i = 0; i < this->frame.size(); i++)
	{
		if (frame[i] == frm)
		{
			return true;
		}
	}
	return false;
}

bool Tracklet::NextProcess(int lastFrm)
{
	lastFrm = *std::max_element(frame.begin(), frame.end());
	this->discrmSet.clear();
	int i = 0;
	do 
	{
		if (frame[i] != lastFrm)
		{
			frame.erase(frame.begin() + i);
			this->trackletSet.erase(trackletSet.begin() + i);
		}
		else
		{
			i++;
		}
	} while (i < frame.size());
	if (trackletSet.size() == 0)
	{
		return false;
	}
	else
	{
		return true;
	}
}